import { createChunks } from './createChunks.js'

const chunkSize = 5 * 1024 * 1024 // 分片大小 5MB

export async function cutFile(file) {
  const totalChunks = Math.ceil(file.size / chunkSize)
  const result = []
  for (let i = 0; i < totalChunks; i++) {
    const chunk = await createChunks(file, i, chunkSize)
    result.push(chunk)
  }
  return result
}
